class CategorySweeper < ActionController::Caching::Sweeper
	observe Category
	
	def after_create(category)
		expire(category)
	end
	
	def after_update(category)
		expire(category)
	end
	
	def after_destroy(category)
		expire(category)
	end
	
	private
	def expire(category)
		expire_fragment(:controller=>"/includes", :action=>"menu")
		expire_fragment(:controller=>"/includes", :action=>"categories")
	end
end
